package com.uduemc.biso.web.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.uduemc.biso.core.extities.node.custom.LoginNode;
import com.uduemc.biso.web.api.server.LoginNodeService;

@RestController
@RequestMapping("/api")
public class LoginTokenController {

	@Autowired
	private LoginNodeService loginNodeServiceImpl;

	@PostMapping("/node/login-token")
	public LoginNode login(@RequestParam("token") String token) {
		return loginNodeServiceImpl.loginToken(token);
	}

	@PostMapping("/node/relogin-token")
	public LoginNode relogin(@RequestParam("relogintoken") String relogintoken) {
		return loginNodeServiceImpl.reLoginToken(relogintoken);
	}

}
